package com.chenc.dao;

import com.chenc.pojo.Usr;
import org.apache.ibatis.annotations.CacheNamespaceRef;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.Alias;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


//@CacheNamespaceRef
public interface UserMapper {

    List<Usr> getUserList();

    @Select("SELECT * FROM usr WHERE user_id = #{id}")
    Usr getUserfromId(int id);

    boolean insertUser(Usr usr);
    boolean insertUses(HashMap<String,String> map);

    @Delete("delete from usr where user_id=#{id}")
    boolean deleteUser(int id);

    @Update("update usr set user_pwd = #{user_pwd},user_name=#{user_name}where user_id=#{user_id}" )
    boolean updateUser(Usr usr);

    List<Usr> queryLike(String name);

    Map getUserLists();

    List<HashMap> queryall();

    List<Usr> querybylimit(Map<String,Object> map);



}
